package com.itheima.eurekafeignclient.controller;


import cn.dm.pojo.User;
import com.itheima.eurekafeignclient.service.RefactorHelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignController {
    @Autowired
    RefactorHelloService refactorHelloService;

    @RequestMapping(value = "/feign-consumer", method = RequestMethod.GET)
    public String helloConsumer3() {
        StringBuilder sb = new StringBuilder();
        sb.append(refactorHelloService.hello("czbk")).append("<BR/>");
        sb.append(refactorHelloService.hello("czbk", 30)).append("<BR/>");
        sb.append(refactorHelloService.hello(new User("czbk", 30))).append("<BR/>");
        return sb.toString();
    }
}
